#include "Stdafx.h"
#include "Tile.h"

namespace Pulpy
{
	void Tile::draw(float minX, float minY, float maxX, float maxY)
	{
		float hWidth = getWidth() / 2;
		float hHeight = getHeight() / 2;
		glColor4f(1,1,1,1);
		glPushMatrix();
			glTranslatef(getPosition().getX(), getPosition().getY(), 0);
			glBegin(GL_QUADS);
				glTexCoord2f(minX,minY); glVertex2f(hWidth, hHeight);
				glTexCoord2f(maxX,minY); glVertex2f(-hWidth, hHeight);
				glTexCoord2f(maxX,maxY); glVertex2f(-hWidth, -hHeight);
				glTexCoord2f(minX,maxY); glVertex2f(hWidth, -hHeight);
			glEnd();
		glPopMatrix();
	}
}